package com.bw.server.server

import com.bw.common.view.BaseMvvmFragment
import com.bw.server.R
import com.bw.server.databinding.FragmentServerBinding
import com.bw.server.entity.ServiceEntity
import com.bw.server.entity.ServiceEntityItem
import dagger.hilt.android.AndroidEntryPoint
@AndroidEntryPoint
class ServerFragment : BaseMvvmFragment<FragmentServerBinding>() {



    val serverList = listOf(
        ServiceEntity(1,"为你推荐",listOf(
            ServiceEntityItem(1,"访客预约", R.drawable.ic_item),
            ServiceEntityItem(2,"会议室预定", R.drawable.ic_item),
            ServiceEntityItem(3,"物品放行", R.drawable.ic_item),
            ServiceEntityItem(4,"物业保修", R.drawable.ic_item),
            ServiceEntityItem(5,"园区资讯", R.drawable.ic_item),
        ) ),
        ServiceEntity(2,"物业服务", listOf(
            ServiceEntityItem(1,"合同管理", R.drawable.ic_item),
            ServiceEntityItem(2,"房源管理", R.drawable.ic_item),
            ServiceEntityItem(3,"租户管理", R.drawable.ic_item),
            ServiceEntityItem(4,"消防管理", R.drawable.ic_item),
            ServiceEntityItem(5,"储柜管理", R.drawable.ic_item),
            ServiceEntityItem(6,"企业管理", R.drawable.ic_item),
            ServiceEntityItem(7,"食堂管理", R.drawable.ic_item),
        )),
        ServiceEntity(3,"企业服务", listOf(
            ServiceEntityItem(1,"人力资源", R.drawable.ic_item),
            ServiceEntityItem(2,"融资服务", R.drawable.ic_item),
            ServiceEntityItem(3,"法律服务", R.drawable.ic_item),
            ServiceEntityItem(4,"考勤管理", R.drawable.ic_item),
            ServiceEntityItem(5,"产业资讯", R.drawable.ic_item),
        )),
        ServiceEntity(4,"人才关爱", listOf(
            ServiceEntityItem(1,"商家", R.drawable.ic_item),
            ServiceEntityItem(2,"月卡会员", R.drawable.ic_item),
            ServiceEntityItem(3,"人才库", R.drawable.ic_item)
        )),
        ServiceEntity(5,"外包服务", listOf(
            ServiceEntityItem(1,"访客预约", R.drawable.ic_item)
        )),
        ServiceEntity(6,"基础服务", listOf(
            ServiceEntityItem(1,"设备管理", R.drawable.ic_item),
            ServiceEntityItem(2,"能源管理", R.drawable.ic_item)
        )),
    )




    val adapter = ServiceAdapter()




    override fun getLayoutId(): Int = R.layout.fragment_server

    override fun initView() {


        mDataBinding.rv.adapter = adapter
        adapter.setList(serverList)


    }

}

data class ServerEntity(
    val id:Int,
    val title:String,//标题
    val image:Int,//文字
)
